﻿using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Geometry
{
    [XmlRoot("close", Namespace = Constants.Main)]
    public class CloseShapePath : XmlSerializable, IPathElement
    {
        public CloseShapePath() { }
    }

    [XmlRoot("moveTo", Namespace = Constants.Main)]
    public class MovePathTo : XmlSerializable, IPathElement
    {
        [XmlElement("pt", Namespace = Constants.Main)]
        public Point Point { get; set; }

        public MovePathTo() { }
    }

    [XmlRoot("lnTo", Namespace = Constants.Main)]
    public class DrawLineTo : XmlSerializable, IPathElement
    {
        [XmlElement("pt", Namespace = Constants.Main)]
        public Point Point { get; set; }

        public DrawLineTo() { }
    }

    [XmlRoot("arcTo", Namespace = Constants.Main)]
    public class DrawArcTo : XmlSerializable, IPathElement
    {
        [XmlAttribute("wR", Form = XmlSchemaForm.Qualified)]
        public string WidthRadius { get; set; }

        [XmlAttribute("hr", Form = XmlSchemaForm.Qualified)]
        public string HeightRadius { get; set; }

        [XmlAttribute("stAng", Form = XmlSchemaForm.Qualified)]
        public string StartAngle { get; set; }

        [XmlAttribute("swAng", Form = XmlSchemaForm.Qualified)]
        public string SwingAngle { get; set; }

        public DrawArcTo() { }
    }

    [XmlRoot("quadBezTo", Namespace = Constants.Main)]
    public class DrawQuadraticBezierCurveTo : XmlSerializable, IPathElement
    {
        [XmlElement("pt", Namespace = Constants.Main)]
        public Point[] Point { get; set; }

        public DrawQuadraticBezierCurveTo() 
        {
            Point = new Point[2];
        }
    }

    [XmlRoot("cubicBezTo", Namespace = Constants.Main)]
    public class DrawCubicBezierCurveTo : XmlSerializable, IPathElement
    {
        [XmlElement("pt", Namespace = Constants.Main)]
        public Point[] Point { get; set; }

        public DrawCubicBezierCurveTo() 
        {
            Point = new Point[3];
        }
    }
}
